Skip to content

V2: Strip only last .proto suffix for DescFile.name#807

Merged
timostamm merged 2 commits intov2from
tstamm/DescFile.name
Apr 23, 2024
Merged

V2: Strip only last .proto suffix for DescFile.name#807
timostamm merged 2 commits intov2from
tstamm/DescFile.name

Conversation

@timostamm
Copy link
Member

No description provided.

deprecated: proto.options?.deprecated ?? false,
edition: getFileEdition(proto),
name: proto.name.replace(/\.proto/, ""),
name: proto.name.replace(/\.proto$/, ""),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously, this removed the first sub-string.

`syntax="proto3";`,
"foo.proto/baz.proto.proto",
);
expect(file.name).toBe("foo.proto/baz.proto");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without the change above, name would be "foo/baz.proto.proto".

keyField.scalar != ScalarType.DOUBLE,
);
const valueField = mapEntry.fields.find((f) => f.proto.number === 2);
const valueField = mapEntry.fields.find((f) => f.number === 2);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use DescField.number here, no need to go through FieldDescriptorProto.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants